package com.jcc.springcloud.service.impl;

import com.jcc.springcloud.file.FuncResource;
import com.jcc.springcloud.service.ManagerService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

@Service
public class MangerServiceImpl implements ManagerService {
    @Override
    public  FuncResource upload(@RequestBody FuncResource funcResource) throws Exception {
        if(funcResource.getFuncName().isEmpty()){
            throw new Exception("函数名不能为空！");
        }
        if(funcResource.getFuncContent().isEmpty()){
            throw new Exception("函数内容不能为空！");
        }

        //上传给阿里云serverless服务
        return funcResource;
    }
}
